<template>
  <div>
    <u-popup v-model="_isDownload" @close="close">
        <div class="wrap fboxCol Ycenter">
            <div class="QrCode fboxCol Ycenter Xcenter">
                <div class="hd font28 color-2E2E33">扫一扫</div>
                <div class="bd fboxCol Ycenter color-8B8B99">
                    <div class="fboxCol Ycenter font24">
                      <img src="https://ebc-prod.cdn.benwunet.com/uni-static/img3.3.0/code.png" class="code" alt="">
                    </div>
                    <div class="font20" v-show="mac">请在Appstore 中查找 本无名片</div>
                </div>
                <div class="ft font24 color-8B8B99">手机应用下载</div>
            </div>
            <div class="close color-fff" @click="close"><span class="bksIcon bks-a-ziyuan138cha"></span></div>
        </div>
    </u-popup>
    <u-popup v-model="_isWeChat" position="top" @close="close">
        <div class="wrap fboxCol Ycenter" style="margin-top: 30px" @close="close">
            <img src="https://ebc-prod.cdn.benwunet.com/uni-static/img3.3.0/browser.png" class="browser" alt="">
            <!-- <img src="@/assets/img/browser.png" width="274" height="auto" alt=""> -->
        </div>
    </u-popup>
  </div>
</template>

<script>
export default {
  name: 'modal.app.download',
  components: {},
  props: {
    isDownload: {
      type: Boolean,
      default: false
    },
    isWeChat: {
      type: Boolean,
      default: false
    }
  },
  data(){
    return {
      playEnd: false,
      logoUrl: 'https://ebc-prod.cdn.benwunet.com/uni-static/img3.3.0/logo.png',
      downloadUrl: '/appDownload',
      mac: false
    }
  },
  computed:{
    _isDownload:{
      get(){
        return this.isDownload
      },
      set(val){
        this.$emit('update:isDownload',val)
      }
    },
    _isWeChat:{
      get(){
        return this.isWeChat
      },
      set(val){
        this.$emit('update:isWeChat',val)
      }
    }
  },
  mounted(){
	// #ifdef H5
      let href = window.location.href
      const index = href.indexOf('/#/?')
      href = href.substring(0, index+3)
      this.downloadUrl = href +'appDownload'
      console.log(href +'appDownload')
      const ua = navigator.userAgent.toLocaleLowerCase()
      if(ua.indexOf("mac os") != -1){this.mac = true}
	  // #endif
  },
  methods:{
    close() {
        this._isDownload = false
        this._isWeChat = false
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
    .van-popup{background: none}
    .QrCode {
        width: 570px;
        height: 556px;
        background-color: #fff;
        overflow: hidden;
        border-radius: 28px;
    }

    .QrCode .bd {
        margin: 50px 0 30px;
    }

    .QrCode .code {
        width: 300px;
        height: 300px;
        overflow: hidden;
    }
    .browser{width: 474px;height: auto;}

    .color-2E2E33 {
        color: #2E2E33;
    }

    .color-8B8B99 {
        color: #8B8B99
    }

    .video-wrap ::v-deep .van-popup {
        background: none
    }

    .close {
        margin-top: 60px
    }

    .close .bksIcon {
        font-size: 60px
    }
</style>
